package edu.cueb.wmis.mapper;

import edu.cueb.wmis.pojo.Orderbillitem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author liuzizhuo
 * @since 2021-04-19
 */
public interface OrderbillitemMapper extends BaseMapper<Orderbillitem> {

    List<Integer> selectOutGoodIds(Integer oid);
    @Select("SELECT orbi.* FROM tb_outbill ob LEFT JOIN tb_orderbill orb ON orb.`id` = ob.`orderId` LEFT JOIN tb_orderbillitem orbi ON orbi.`billId` = orb.`id` WHERE ob.`outTime` <= #{now} AND orb.`state`=1;")
    List<Orderbillitem> getOutGoodIds(LocalDate now);

    List<Orderbillitem> selectOrderYetPdListByOutbill(List<Integer> outYetPdList);
}
